import request from '@/utils/request'

export function getAllAreas(currentPage, pageSize) {
  return request({
    url: '/shike3k/allArea/getAllAreas/' + currentPage + '/' + pageSize,
    method: 'get'
  })
}
//根据区域名找区域
export function searchAreaByName(areaName) {
  return request({
    url: '/shike3k/allArea/findAreaByName/' + areaName,
    method: 'get'
  })
}
//根据ID找区域
export function searchAreaById(areaId,currentPage, pageSize) {
  return request({
    url: '/shike3k/allArea/getAreaById/' + areaId + '/' + currentPage + '/' + pageSize,
    method: 'get'
  })
}

// 添加区域
export function addArea(data) {
  return request({
    url: '/shike3k/allArea/addArea',
    method: 'post',
    data
  })
}

// 删除区域
export function delArea(areaId) {
  return request({
    url: '/shike3k/allArea/deleteAreaById/' + areaId,
    method: 'get'
  })
}

// 获取区域下用户
export function getUserOfArea(areaId, currentPage, pageSize) {
  return request({
    url: 'shike3k/allUser/getUserListByAreaId/' + areaId + '/' + currentPage + '/' + pageSize,
    method: 'get'
  })
}

// 获取区域下设备
export function getProbeByAreaId(areaId, currentPage, pageSize) {
  return request({
    url: '/shike3k/allProbe/getProbeByAreaId/' + areaId + '/' + currentPage + '/' + pageSize,
    method: 'get'
  })
}

// 获取全部设备
export function getAllProbe(currentPage, pageSize) {
  return request({
    url: '/shike3k/allProbe/getAllProbes/' + currentPage + '/' + pageSize,
    method: 'get'
  })
}

// 删除设备
export function deleteProbe(probeId) {
  return request({
    url: '/shike3k/allProbe/deleteProbe/' + probeId,
    method: 'post'
  })
}
